import 'package:flutter/material.dart';

class CustomAssetImage extends StatelessWidget {
  final double width, height;
  final String netPath;

  const CustomAssetImage(
      {super.key,
      required this.width,
      required this.height,
      required this.netPath});

  @override
  Widget build(BuildContext context) {
    return Image.asset(netPath,
            width: width,
            height: height,
            fit: BoxFit.cover, errorBuilder: (context, error, stackTrace) {
      return Container(
        width: width,
        height: height,
        color: Colors.grey,
        alignment: Alignment.center,
        child: const Icon(
          Icons.error,
          color: Colors.white,
        ),
      );
    });
  }
}
